#include <bits/stdc++.h>
using namespace std;

struct student
{
    unsigned id;
    float score;
};

bool cmp(int a, int b)
{
    return a>b;
}

int main(int argc, char const *argv[])
{
    // 输入学生的人数n
    int n;
    cin >> n;

    // 输入要求的第k名
    int k;
    cin >> k;

    // 输入n个学生的学号和成绩
    student a[n];
    float b[n];
    for(int i=0; i<n; i++)
    {
        cin >> a[i].id >> a[i].score;
        b[i] = a[i].score;
    }
    sort(b, &b[n], cmp);

    // 求出第k名的学号和成绩
    for(int i=0; i<n; i++)
    {
        if(a[i].score == b[k-1])
            cout << a[i].id << " " << a[i].score << endl;
    }

    return 0;
}
